﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2013/8/29 星期四 23:38:12
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sector7.Medical.EntityType;
using Sector7.Medical.Enums;
using System.Windows.Controls;

namespace Sector7.Medical.Biz
{
    /// <summary>
    /// 医疗系统环境变量
    /// </summary>                
    public static class Menvironments
    {
        #region Accessor
        /// <summary>
        /// 读卡器端口号
        /// </summary>
        public const int PORT = 0;

        /// <summary>
        /// 运行频率波段
        /// </summary>
        public const int BAUD = 9600;

        /// <summary>
        /// 数据存储的IC卡扇区号
        /// </summary>
        public const int SECTOR_NUMBER = 1;                     // M1卡共16个扇区

        /// <summary>
        /// 数据存储的IC卡块号
        /// </summary>
        public const int BLOCK_NUMBER = SECTOR_NUMBER * 4 + 0;  // M1卡每个扇区共4个块

        /// <summary>
        /// 获取或设置主控件
        /// </summary>
        public static Control MainControl { get; set; }

        /// <summary>
        /// 获取当前用户信息
        /// </summary>
        public static M7_Employee CurrentAccount
        {
            get { return m_currentAccount; }
        }

        /// <summary>
        /// 获取当前科室信息
        /// </summary>
        public static M7_Department CurrentDepartment
        {
            get { return m_currentDepartment; }
        }

        /// <summary>
        /// 获取当前系统所在行政区划编码
        /// </summary>
        public static string AdministrativeCode
        {
            get { return m_administrativeCode; }
        }
        #endregion

        #region Public functions
        #endregion

        #region Private functions
        #endregion

        #region Structure
        static Menvironments()
        {
            /////// For testing
            m_currentAccount = new M7_Employee();
            m_currentAccount.CitizenId = "510922198306240175";
            m_currentAccount.EmpId = 19960723;
            m_currentAccount.FullName = "David Beckham";

            m_currentDepartment = new M7_Department();
            m_currentDepartment.DeptId = 999;
            m_currentDepartment.DeptName = "内科一";

            m_administrativeCode = "510922";
            //:~
        }
        #endregion

        #region Inner members
        private static M7_Employee m_currentAccount = null;
        private static M7_Department m_currentDepartment = null;
        private static string m_administrativeCode = string.Empty;
        #endregion
    }
}
